package com.evan.review.architecture;

import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;

import com.evan.review.R;
import com.evan.review.architecture.mvc.MVCExampleActivity;
import com.evan.review.architecture.mvp.MVPExampleActivity;
import com.evan.review.architecture.mvvm.view.MVVMExampleActivity;
import com.evan.review.architecture.mvi.MVIExampleActivity;
import com.evan.review.architecture.components.ComponentsMainActivity;

/**
 * UI架构模式学习主界面
 * 本模块展示Android中常见的UI架构模式及其实际应用
 */
public class ArchitectureMainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_architecture_main);
        
        initViews();
    }
    
    private void initViews() {
        // MVC架构模式
        Button btnMVC = findViewById(R.id.btn_mvc);
        btnMVC.setOnClickListener(v -> {
            startActivity(new Intent(this, MVCExampleActivity.class));
        });
        
        // MVP架构模式
        Button btnMVP = findViewById(R.id.btn_mvp);
        btnMVP.setOnClickListener(v -> {
            startActivity(new Intent(this, MVPExampleActivity.class));
        });
        
        // MVVM架构模式
        Button btnMVVM = findViewById(R.id.btn_mvvm);
        btnMVVM.setOnClickListener(v -> {
            startActivity(new Intent(this, MVVMExampleActivity.class));
        });
        
        // MVI架构模式
        Button btnMVI = findViewById(R.id.btn_mvi);
        btnMVI.setOnClickListener(v -> {
            startActivity(new Intent(this, MVIExampleActivity.class));
        });
        
        // Jetpack组件
        Button btnComponents = findViewById(R.id.btn_components);
        btnComponents.setOnClickListener(v -> {
            startActivity(new Intent(this, ComponentsMainActivity.class));
        });
        
        // 架构对比
        Button btnComparison = findViewById(R.id.btn_architecture_comparison);
        btnComparison.setOnClickListener(v -> {
            startActivity(new Intent(this, ArchitectureComparisonActivity.class));
        });
    }
} 